package cn.chen.miaosha.service;

import cn.chen.miaosha.dao.UserDao;
import cn.chen.miaosha.domain.MiaoshaUser;
import cn.chen.miaosha.domain.User;
import cn.chen.miaosha.redis.RedisService;
import cn.chen.miaosha.vo.LoginVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.thymeleaf.util.StringUtils;


@Service
public class UserService {

    @Autowired
    UserDao userDao;

    public User getById(int id){
        return userDao.getById(id);
    }

//    @Transactional
    public boolean tx() {
        User u1 = new User();
        u1.setId(2);
        u1.setName("fef");
        userDao.insert(u1);

        User u2 = new User();
        u1.setId(1);
        u1.setName("fef2");
        userDao.insert(u2);

        return true;
    }
}
